<!DOCTYPE HTML>
<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 
    <title></title>
	<script type="text/javascript" src="js/include.js"></script>
	<script type="text/javascript">
		function addTab(title, url){
			if ($('#tt').tabs('exists', title)){
				$('#tt').tabs('close',title);
			} 
			var content = '<iframe scrolling="auto" frameborder="0"  src="'+url+'" style="width:100%;height:100%;"></iframe>';
			$('#tt').tabs('add',{
				title:title,
				content:content,
				closable:true
			});
			
		}
		
		$(function(){ 
			$('#tree').tree({
				url: url+'/system/resources/findResourcesEMUByResources',
			 	onClick: function(node){
			       if($('#tree').tree('isLeaf',node.target)){//判断是否是叶子节点
			    	   addTab(node.text,htmlURL+node.attributes.url)
			       }
			    }
			});
		}); 
		function logout(){
			  $.messager.confirm("确认", "确认注销吗？", function (r) {
			        if (r) {
						$.ajax({   
							url:url+"/logoutJSON",   
							success:function(data){   	
							}
						});
						window.location=htmlURL+"/login.html";
			        }
			    });
		}
		function edit(){
			 addTab("更改密码", htmlURL+"/system/user/updatePassword.html");
		}
	</script>
  </head>
  
 
    
   
  <body class="easyui-layout">
    <div data-options="region:'north'" style="height:70px;">
    	<div style="margin-top: 20px;padding-left: 50px;">
	    	<span style="font-size: 20px;"></span>
         </div>
    </div>
    
   
    <div data-options="region:'west',title:'菜单'" style="width:200px;">
    	<div id="tree"></div>
    </div>
    <div id="tt"   class="easyui-tabs" data-options="region:'center',border:false,tools:'#tab-tools'" >
    	<div title="首页" style="padding:10px">
			<p style="font-size:14px"></p>
			
		</div>
	
    </div>
    <div id="tab-tools">
		<a href="javascript:void(0)" class="easyui-linkbutton" data-options="plain:true,iconCls:'icon-edit'" onclick="edit()">更改密码</a>
		<a href="javascript:void(0)" class="easyui-linkbutton" data-options="plain:true,iconCls:'icon-no'" onclick="logout()">退出</a>
	</div>
</body>
</html>
